﻿using GalaSoft.MvvmLight;
using Tp.Interfaces;
using Tp.Interfaces.Commands;
using Tp.Interfaces.ViewModels;

namespace Tp.TreeViewModel
{
	public class TreeViewUserControlViewModel : ViewModelBase, ITreeViewUserControlViewModel
	{
		#region Fields

		private bool _isExpandedGeschaeftsfaelle;
		private bool _isExpandedProjekte;
		private bool _isExpandedStammdaten;
		private bool _isExpandedReports;
		private bool _isExpandedBereiche;
		private bool _isExpandedSuche;

		#endregion

		#region Properties

		public bool IsExpandedGeschaeftsfaelle
		{
			get { return this._isExpandedGeschaeftsfaelle; }
			set
			{
				if (this._isExpandedGeschaeftsfaelle == value)
				{
					return;
				}

				this._isExpandedGeschaeftsfaelle = value;
				RaisePropertyChanged(() => IsExpandedGeschaeftsfaelle);

				if (!value) return;
				//this.IsExpandedProjekte = false;
				//this.IsExpandedStammdaten = false;
				//this.IsExpandedReports = false;
				//this.IsExpandedBereiche = false;
				//this.IsExpandedSuche = false;
			}
		}

		public bool IsExpandedProjekte
		{
			get { return this._isExpandedProjekte; }
			set
			{
				if (this._isExpandedProjekte == value)
				{
					return;
				}

				this._isExpandedProjekte = value;
				RaisePropertyChanged(() => IsExpandedProjekte);

				if (!value) return;
				//this.IsExpandedGeschaeftsfaelle = false;
				//this.IsExpandedStammdaten = false;
				//this.IsExpandedReports = false;
				//this.IsExpandedBereiche = false;
				//this.IsExpandedSuche = false;
			}
		}

		public bool IsExpandedStammdaten
		{
			get { return this._isExpandedStammdaten; }
			set
			{
				if (this._isExpandedStammdaten == value)
				{
					return;
				}

				this._isExpandedStammdaten = value;
				RaisePropertyChanged(() => IsExpandedStammdaten);

				if (!value) return;
				//this.IsExpandedProjekte = true;
				//this.IsExpandedGeschaeftsfaelle = true;
				//this.IsExpandedReports = false;
				//this.IsExpandedBereiche = false;
				//this.IsExpandedSuche = false;
			}
		}

		public bool IsExpandedReports
		{
			get { return this._isExpandedReports; }
			set
			{
				if (this._isExpandedReports == value)
				{
					return;
				}

				this._isExpandedReports = value;
				RaisePropertyChanged(() => IsExpandedReports);

				if (!value) return;
				//this.IsExpandedProjekte = false;
				//this.IsExpandedStammdaten = false;
				//this.IsExpandedGeschaeftsfaelle = false;
				//this.IsExpandedBereiche = false;
				//this.IsExpandedSuche = false;
			}
		}

		public bool IsExpandedBereiche
		{
			get { return this._isExpandedBereiche; }
			set
			{
				if (this._isExpandedBereiche == value)
				{
					return;
				}

				this._isExpandedBereiche = value;
				RaisePropertyChanged(() => IsExpandedBereiche);

				if (!value) return;
				//this.IsExpandedProjekte = false;
				//this.IsExpandedStammdaten = false;
				//this.IsExpandedReports = false;
				//this.IsExpandedGeschaeftsfaelle = false;
				//this.IsExpandedSuche = false;
			}
		}

		public bool IsExpandedSuche
		{
			get { return this._isExpandedSuche; }
			set
			{
				if (this._isExpandedSuche == value)
				{
					return;
				}

				this._isExpandedSuche = value;
				RaisePropertyChanged(() => IsExpandedSuche);

				if (!value) return;
				//this.IsExpandedProjekte = false;
				//this.IsExpandedStammdaten = false;
				//this.IsExpandedReports = false;
				//this.IsExpandedBereiche = false;
				//this.IsExpandedGeschaeftsfaelle = false;
			}
		}

        public ITreeViewModelCommands Commands { get; set; }

        #endregion

        #region C-Tor

        public TreeViewUserControlViewModel(ITreeViewModelCommands commands)
		{
		    this.Commands = commands;
			this.RegisterMessengers();
		}

		#endregion

		#region Messengers

		private void RegisterMessengers()
		{

		}

		#endregion

		#region Private methods


		#endregion
	}
}